package com.wangjiang.mario.admin.common.object;

import com.wangjiang.mario.admin.common.base.BaseEntity;
import lombok.Data;

import java.util.List;

/**
 * 存在shiro工具类中的用户角色
 */

@Data
public class UserModel extends BaseEntity {

    private String userName;

    private String realName;

    private String email;

    private String phone;

    private List<RoleModel> roles;

    /**
     * 是否系统超级管理员 id=1的员工
     *
     * @return
     */
    public Boolean isAdmin() {
        return isAdmin(getId());
    }

    public Boolean isAdmin(Long id) {
        return id != null && id == 1;
    }
    public static Boolean isSuperAdmin(Long id) {
        return id != null && id == 1;
    }
}
